{extend name='table'}

{block name="button"}

<!--{if auth("add")}-->
<button data-modal='{:url("add")}' data-area="['750px', '750px']" data-title="{:lang('添加课程')}" class='layui-btn layui-btn-sm layui-btn-primary'>{:lang('添加渠道')}</button>
<!--{/if}-->

{/block}

{block name="content"}
<div class="layui-tab layui-tab-card">
    <div class="layui-tab-content">
        {include file='order_packing/index_search'}
        <table id="UserTable" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
    </div>
</div>
<script>
    var maxWidth = window.innerWidth;
    var maxHeight = window.innerHeight;

    var account_show = {$account_show};

    $(function () {
        $('#UserTable').layTable({
            even: true, height: 'full',
            where: {type: '{$type|default="index"}'},
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'warehouse_name', title: '{:lang("仓库公司")}', minWidth: 150, align: 'center' , hide:!account_show  },
                {field: 'warehouse_name', title: '{:lang("仓库")}', minWidth: 150, align: 'center'  },
                {field: 'account_name', title: '{:lang("商品公司")}', minWidth: 150, align: 'center'  },
                {field: 'platform_name', title: '{:lang("三方平台")}', minWidth: 150, align: 'center'  },
                {field: 'order_no', title: '{:lang("订单号")}', minWidth: 150, align: 'center'  },
                {field: 'goods_sku', title: '{:lang("商品sku")}', minWidth: 100, align: 'center'  },
                {field: 'goods_name', title: '{:lang("商品名字")}', minWidth: 150, align: 'center'},
                {field: 'num', title: '{:lang("商品数量")}', minWidth: 80, align: 'center' },
                {field: 'location_code', title: '{:lang("货位")}', align: 'center', minWidth: 120, },
                {field: 'status', title: '{:lang("状态")}', align: 'center', minWidth: 100, },
                {field: 'create_at', title: '{:lang("入库时间")}', align: 'center', minWidth: 150, },
                {toolbar: '#toolbar', title: '{:lang("操作面板")}', align: 'center', minWidth: 100, fixed: 'right'}
            ]]
        });
    });
</script>

<!-- 数据状态切换模板 -->
<script type="text/html" id="StatusSwitchTpl">
    <!--{if auth("state")}-->
    <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="{:lang('已激活')}|{:lang('已禁用')}" lay-filter="StatusSwitch" {{-d.status>0?'checked':''}}>
    <!--{else}-->
    {{-d.status ? '<b class="color-green">{{d.status}}</b>' : '<b class="color-red">{:lang("已禁用")}</b>'}}
    <!--{/if}-->
</script>

<script type="text/html" id="toolbar">

    <!--{if auth("edit")}-->
    <a class="layui-btn layui-btn-sm"   data-title="{:lang('编辑用户')}"  data-modal='{:url("edit")}?id={{d.id}}'>{:lang('编 辑')}</a>
    <!--{/if}-->


</script>
{/block}
